
#include <string>
#include <functional>
#include <system_error>
#include <optional>

namespace helper {
namespace sqlite {
  class IDB;
  class Statement;
}//namespace sqlite
}//namespace helper

namespace helper {
namespace sqlite {
namespace shortcut {

class Query;

class QueryScalar {
public:
  using fbind_type = std::function<std::error_code (Statement & stmt)>;

  QueryScalar(IDB & db);
  ~QueryScalar();

  std::error_code queryInteger(const std::string & sql, int & v, const fbind_type & fbind = fbind_type()) const;
  std::error_code queryReal(const std::string & sql, double & v, const fbind_type & fbind = fbind_type()) const;
  std::error_code queryText(const std::string & sql, std::string & v, const fbind_type & fbind = fbind_type()) const;
  std::error_code queryBinary(const std::string & sql, std::string & v, const fbind_type & fbind = fbind_type()) const;

private:
  Query * _query;
};







}//namespace shortcut
}//namespace sqlite
}//namespace helper
